package com.myhome.money.redis.pubsub;

import redis.clients.jedis.Jedis;

/**
 * @author Rod
 */
public class Subscribe {

    public static void main(String[] args) {
        Subscribe subscribe = new Subscribe();
        try {
            subscribe.testSubscribe();
            System.in.read();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void testSubscribe() throws Exception {
        Jedis jedis = new Jedis("localhost", 6379);
        jedis.auth("RedisAdmin");
        RedisMsgPubSubListener listener = new RedisMsgPubSubListener();
        jedis.subscribe(listener, "redisChatTest");
        //other code
    }
}
